class Box
{
	private double length , width , height;

	Box(double boxLength , double boxWidth , double boxHeight) throws IllegalArgumentException
	{
		if(boxLength <= 0 || boxWidth <= 0 || boxHeight <= 0)
			throw new IllegalArgumentException("Error: Dimension <= 0");

		length = boxLength;
		width = boxWidth;
		height = boxHeight;
	}

	public double volume()
	{
		return length * width * height;
	}

	public double surfaceArea()
	{
		return 2*(length*width + length*height + width*height);
	}
} 

public class BoxDriver 
{
	public static void main(String[] args)
	{
		// Create two Box objects
		Box box1 = null, box2 = null;
		try{
		  box1 = new Box(20.0, 10.0, 15.0);
		  box2 = new Box(6.0, 4.0, 2.0);
		}
		catch(IllegalArgumentException e){
			System.out.println(e);
			System.exit(1);
		}
		double volume, area;

		// Get and display volume and surface area of box1
		volume = box1.volume();
		area = box1.surfaceArea();
		System.out.println("The volume of box1 is " + volume + " cubic cm");
		System.out.println("The surface area of box1 is "+area+" square cm\n");

		// Get and display volume of surface area box2
		System.out.println("The volume of box2 is " + box2.volume() + " cubic cm");
		System.out.println("The surface area of box2 is " + box2.surfaceArea() +" square cm\n");
	}
}
